#pragma once

#include "cgzITask.h"

class cgzCSpdLog;

class cgzCSpdItem : public cgzIData
{
public:
    friend class cgzCSpdLog;
    cgzCSpdItem(const u_int8_t fid, const u_int8_t flg, std::string &msg);
    ~cgzCSpdItem();

private:
    u_int8_t m_fid;    // 日志文件标识
    u_int8_t m_flg;    // 日志等级标识
    std::string m_msg; // 日志内容
};

class cgzCSpdLog : public cgzITask
{
public:
    cgzCSpdLog(cgzCThreadPool *pool, const char *name);
    ~cgzCSpdLog();
    bool run(int64_t nms) override;

public:
    uint8_t Customize(const char *fname, bool outconsole);

private:
    std::string m_dir;
};
